package com.fansl.allround.open.api.feign.factory;

import com.fansl.allround.open.api.feign.RemoteJuHeService;
import com.fansl.allround.open.api.feign.fallback.RemoteJuHeServiceFallbackImpl;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author fansl
 * @Description: TODO
 * @date 2019/9/10 19:00
 */
@Component
public class RemoteJuHeServiceFallbackFactory implements FallbackFactory<RemoteJuHeService> {
    @Override
    public RemoteJuHeService create(Throwable throwable) {
        RemoteJuHeServiceFallbackImpl fallback = new RemoteJuHeServiceFallbackImpl();
        fallback.setCause(throwable);
        return fallback;
    }
}
